package com.softeem.mpdemo.controller;

import com.softeem.mpdemo.dto.Result;
import com.softeem.mpdemo.entity.Ablum;
import com.softeem.mpdemo.service.AblumService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Tag(name = "专辑管理",description = "专辑相关访问操作，包含：新增，检索，修改，删除等")
@CrossOrigin
@RestController
public class AblumController {

    @Autowired
    private AblumService ablumService;

    @Operation(summary = "专辑列表查询",description = "查询所有专辑信息,为上传歌曲时做关联使用")
    @GetMapping("/ablum/listAll")
    public Result queryAll(){
        List<Ablum> list = ablumService.list();
        return Result.ok().setData(list);
    }
}
